Skip to content

Conversation

mathieuchopstm
Copy link
Contributor

@mathieuchopstm mathieuchopstm commented Oct 7, 2025

Update documentation related to platform hooks:

  • make sure the hook functions' documentation is actually visible - currently, the dummy no-op macros are seen instead (c.f. https://docs.zephyrproject.org/latest/doxygen/html/hooks_8h.html)
  • update architecture porting documentation to include a section about hooks that must be implemented in arch-specific code
    • this should reflect current practices and expectations

The hooks' signature was not visible to Doxygen due to preprocessor
conditionals - instead, the dummy no-op implementation was seen instead.

Update #ifdef guard to make the hooks' signature and the associated
documentation visible to Doxygen such that it appears in docs.

Also fix a tiny typo on soc_reset_hook()'s documentation comment.

Signed-off-by: Mathieu Choplain <[email protected]>
Document the expected early boot sequence and when platform hooks should be
called by the arch-specific coode, and under what conditions.

Signed-off-by: Mathieu Choplain <[email protected]>
soc_prep_hook() is always called from z_prep_c() which is implemented
as a C function. As such, there is no need to check for the associated
CONFIG_SOC_PREP_HOOK since the platform/hooks.h header will define hooks
as no-op function-like macros if their associated Kconfig isn't enabled.

Remove the Kconfig check from all arch implementations of z_prep_c() and
call soc_prep_hook() directly instead, to avoid duplicating the Kconfig
check already performed in platform/hooks.h

Signed-off-by: Mathieu Choplain <[email protected]>
@mathieuchopstm
Copy link
Contributor Author

Rebased + covered CONFIG_SOC_EARLY_RESET_HOOK + added a cleanup commit for arch files

@mathieuchopstm mathieuchopstm marked this pull request as ready for review October 7, 2025 12:03
@zephyrbot zephyrbot added area: ARC ARC Architecture area: RISCV RISCV Architecture (32-bit & 64-bit) area: Architectures area: X86 x86 Architecture (32-bit) area: Xtensa Xtensa Architecture area: ARM64 ARM (64-bit) Architecture area: ARM ARM (32-bit) Architecture area: SPARC SPARC Architecture area: MIPS labels Oct 7, 2025
Copy link

sonarqubecloud bot commented Oct 7, 2025

@wearyzen wearyzen assigned kartben and unassigned wearyzen Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARC ARC Architecture area: Architectures area: ARM ARM (32-bit) Architecture area: ARM64 ARM (64-bit) Architecture area: MIPS area: RISCV RISCV Architecture (32-bit & 64-bit) area: SPARC SPARC Architecture area: X86 x86 Architecture (32-bit) area: Xtensa Xtensa Architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants